import { createFromIconfontCN } from '@ant-design/icons';
import { Space } from 'antd';
import { values } from 'lodash-es';
import React from 'react';

export const IconFont = createFromIconfontCN({
  scriptUrl: [
    // '//at.alicdn.com/t/xxx.js',
    // '//at.alicdn.com/t/c/font_4454880_rohxlzababd.js',
    './icon-font/font_4454880_rohxlzababd.js',
  ],
});

export enum IconType {
  EdgeCorner = 'icon-edge-corner',
  Edit = 'icon-edit',
  Undo = 'icon-undo',
  Redo = 'icon-redo',
  Lock = 'icon-lock',
  Plank = 'icon-plank',
  Hole = 'icon-hole',
  SquareGroove = 'icon-square-groove',
  RoundCornerGroove = 'icon-round-corner-groove',
}

export const IconFonts: React.FC = () => {
  const iconTypes = values(IconType);
  return (
    <Space>
      {iconTypes.map((iconType) => (
        <IconFont key={iconType} type={iconType} />
      ))}
    </Space>
  );
};
